﻿using Modules.System;
using System.ComponentModel.DataAnnotations;
using System.Xml.Linq;

namespace ManagementApi.Models.System.Menu
{
    /// <summary>
    /// 菜单表单
    /// </summary>
    public class MenuEditForm
    {

        /// <summary>
        /// 菜单id
        /// </summary>
        [Display(Name = "菜单id")]
        public int? MenuId { get; set; }
        /// <summary>
        /// 父菜单ID
        /// </summary>
        [Display(Name = "父菜单ID")]
        public int ParentId { get; set; }

        /// <summary>
        /// 菜单名称
        /// </summary>
        [Display(Name = "菜单名称")]
        [Required(ErrorMessage = "{0}不能为空")]
        public string Name { get; set; } = string.Empty;

        /// <summary>
        /// 菜单类型
        /// </summary>
        [Display(Name = "菜单类型")]
        //[Required(ErrorMessage = "{0}不能为空")]
        public string? Type { get; set; }

        /// <summary>
        /// 路由路径
        /// </summary>
        [Display(Name = "路由路径")]
        //[Required(ErrorMessage = "{0}不能为空")]
        public string Path { get; set; } = string.Empty;

        /// <summary>
        /// 组件路径(vue页面完整路径，省略.vue后缀)
        /// </summary>
        [Display(Name = "组件路径(vue页面完整路径，省略.vue后缀)")]
        public string? Component { get; set; } = string.Empty;

        /// <summary>
        /// 权限标识
        /// </summary>
        [Display(Name = "权限标识")]
        public string? Perm { get; set; }

        /// <summary>
        /// 显示状态(1:显示;0:隐藏)
        /// </summary>
        [Display(Name = "显示状态(1:显示;0:隐藏)")]
        public bool IsVisible { get; set; } = true;

        /// <summary>
        /// 排序(数字越小排名越靠前)
        /// </summary>
        [Display(Name = "排序(数字越小排名越靠前)")]
        public int? Sort { get; set; }

        /// <summary>
        /// 菜单图标
        /// </summary>
        [Display(Name = "菜单图标")]
        public string? Icon { get; set; }

        /// <summary>
        /// 跳转路径
        /// </summary>
        [Display(Name = "跳转路径")]
        public string? Redirect { get; set; }

    }
}
